home *** CD-ROM | disk | FTP | other *** search
- UOBJ Unit Version 1.0 90/01/10
- --------- ----------- --------
-
- This Pascal unit contains the TObj class and was written to:
-
- 1) provide a "better" base object to Turbo Pascal programmers
- 2) enhance portability between Object Pascal and Turbo Pascal (MS/DOS)
- 3) provide the standard base object to Quick Pascal programmers
-
- Author: Mike Babulic Compuserve: 72307,314
- 3827 Charleswood Dr. N.W.
- Calgary, Alberta
- Canada
- T2L 2C7
-
-
- CONTENTS
- --------
-
- UOBJ.DOC - Documentation for this package. The document you are reading.
-
- UOBJ.P - Object Pascal version of the UObj unit. (Macintosh Think Pascal)
- UOBJ.PAS - Turbo Pascal version of the UObj unit.
- UOBJ.QP - Quick Pascal version of the UObj unit.
-
- TEST.PAS - Turbo Pascal example program.
- TEST.QP - Quick Pascal example program.
-
-
- NB. - If you are using Quick Pascal: RENAME *.PAS *.TP
- --- RENAME *.QP *.PAS
- so that the debugger won't get confused
-
-
- DISCUSSION
- ----------
-
- Object Pascal was jointly developed by N. Wirth and Apple Computer.
- The standard root class is called TObject. It contains 2 very useful
- methods:
-
- function Clone:TObject -- creates a copy of SELF
-
- procedure Free -- is a high level "dispose", customized for
- a particular class. It may, for example,
- dispose of storage that is pointed to by
- some fields before disposing of SELF
-
- Turbo Pascal's class library doesn't contain this standard and useful
- object. A TObject equivalent would simplify porting programs to and from
- Object Pascal.
-
- Quick Pascal comes with no class libraries at all, so even though it is
- virtually the same as Object Pascal, there is no TObject class.
- Portability is compromised once again.
-
- Turbo Pascal's C++ heritage means that there are significant differences
- between it and Object Pascal; most notable is that a run-time binding
- is done explicitly with a "constructor" method (Run-time binding is
- automatic in Object Pascal).
-
- constructor Bind; -- performs run-time binding of a variable
- to its class. "New(o,Bind)" in Turbo Pascal
- is equivalent to "New(o)" in Object Pascal.
-
- "SizeOf" works differently in Turbo and Object Pascal.
-
- function Bytes:Longint; -- returns the number of bytes used to store
- an instance of an object
-
- There is no "TypeOf" function in Object Pascal.
-
- function TypeOf:ClassId; -- returns a value representing the class of
- an instance variable.
-
-
- GLOSSARY
- --------
-
- Class - "object" type
-
- Heap - An area of memory reserved for the dynamic allocation of variables
-
- Instance of a Class - See "Instance of an Object"
-
- Instance of an Object - the place in memory where the fields of an
- Instance Variable are stored
-
- Instance Variable - an "object" variable
-
- Object Pascal - an extension of the Pascal language. Developed by N. Wirth
- and Apple for object oriented programming